# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=pangomm

pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=2.34.0
pkgrel=2
pkgdesc="C++ bindings for pango (mingw-w64)"
arch=('any')
url="http://gtkmm.sourceforge.net"
license=("LGPL")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-pkg-config")
depends=("${MINGW_PACKAGE_PREFIX}-cairomm" "${MINGW_PACKAGE_PREFIX}-glibmm" "${MINGW_PACKAGE_PREFIX}-pango")
options=(staticlibs strip)
source=("http://ftp.gnome.org/pub/GNOME/sources/pangomm/${pkgver%.*}/pangomm-$pkgver.tar.xz")
sha256sums=('0e82bbff62f626692a00f3772d8b17169a1842b8cc54d5f2ddb1fec2cede9e41')

prepare() {
  cd "$srcdir/pangomm-$pkgver"
  sed -i -e "s,AC_DISABLE_STATIC,AC_DISABLE_STATIC\nlt_cv_deplibs_check_method='pass_all'," configure.ac
  autoconf --force
}

build() {
  CPPFLAGS+=" -D_REENTRANT"
  mkdir -p "${srcdir}/build-${MINGW_CHOST}"
  cd "${srcdir}/build-${MINGW_CHOST}"
  ../${_realname}-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --enable-shared \
    --enable-static \
    --disable-documentation
  make
}

package() {
  cd "${srcdir}/build-${MINGW_CHOST}"
  make DESTDIR="$pkgdir" install
  find "${pkgdir}${MINGW_PREFIX}" -name '*.def' -o -name '*.exp' | xargs -rtl1 rm
}
